<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户管理</title>
</head>
<body>
	  <table>
		<tr>
			
			<th>序号</th>
			<th>用户名</th>
			<th>邮箱</th>
			<th>注册时间</th>
		</tr>
		<c:forEach var="entity" items="${user}">
                <tr> 
                    <th><input type="checkbox" name="id" value="${entity.id}">${entity.id}</th>
                    <td>${entity.username}</td>
                    <td>${entity.email}</td>
                    <td><fmt:formatDate value="${entity.registtime}" type="date"></fmt:formatDate></td>
                </tr>
         </c:forEach>	
       </table>
          <div id="pager"></div>
        <!--分页 -->
        <script type="text/javascript" src="<c:url value="/scripts/jQuery/jquery-1.10.2.min.js"/>" ></script>
        <link href="<c:url value="/scripts/pagination/pagination.css"/>"  type="text/css" rel="stylesheet" />
        <script type="text/javascript" src="<c:url value="/scripts/pagination/jquery.pagination.js"/>" ></script>
           <script type="text/javascript">
         //  var page=${page};
           //console.log(page);
           //初始化分页组件
           var count=${page.total};
           var size=${page.pages};
           var pageNO=${page.pageNum};
           $("#pager").pagination(count-1, {
              items_per_page:size,
               current_page:pageNO-1,
               next_text:"下一页",
               prev_text:"上一页",
               num_edge_entries:0,
               load_first_page:false,
              callback:handlePaginationClick
            });
           
           //回调方法
           function handlePaginationClick(new_page_index, pagination_container){
               location.href="list?pageNO="+(new_page_index+1);
           }

        </script>
	
</body>
</html>